/*
	This file is part of GTimer.

    GTimer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License\.

    GTimer is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GTimer. If not, see <http://www.gnu.org/licenses/>.
	
	Copyright 2012 Muhammad Ghareeb Sideek
	Contact: MGhareeb64@gmail.com
 */

package com.gsourcecode.utils;

import android.graphics.LinearGradient;
import android.graphics.RadialGradient;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;

public class Gradient {

	public static ShapeDrawable getLin(int x0, int y0, int x1, int y1, int c0, int c1, TileMode repeat) {
		ShapeDrawable out = new ShapeDrawable(new RectShape());
		out.getPaint().setShader(new LinearGradient(x0, y0, x1, y1, c0, c1, repeat));
		return out;
	}

	public static ShapeDrawable getRad(int x0, int y0, int r, int c0, int c1, TileMode repeat) {
		ShapeDrawable out = new ShapeDrawable(new RectShape());
		out.getPaint().setShader(new RadialGradient(x0, y0, r, c0, c1, repeat));
		return out;
	}
}
